try:
    f = open(r"b.txt","a")
    s = "gaoqi"
    f.write(s)
except BaseException as e:
    print(e)
finally:
    f.close()